import { defineStore } from 'pinia';
interface chatMessage {
  userId: string;
  userName: string;
  userAvatar: string;
  message: string;
  time: Date;
  isMine: boolean;
}
export const userChartStore = defineStore('chart', () => {
  const state = ref({
    messageList: [] as chatMessage[]
  });
  /**
   * 向消息列表添加消息
   */
  const addMessage = (message: chatMessage) => {
    state.value.messageList.push(message);
  };
  return {
    state,
    addMessage
  };
});
export default userChartStore;
